-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Earn battle points from trainer battles (with a variable) #5286
Earn battle points from trainer battles (with a variable) #5286
Conversation
src/battle_setup.c
Outdated
#if BATTLE_FRONTIER_INTRO_FOR_BP_FIGHTS | ||
if (VarGet(gSpecialVar_0x8003) == 1) | ||
return GetSpecialBattleTransition(FRONTIER_MODE_DOUBLES); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the preproc block should be a normal if statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll gladly make the change but could you please tell me why that is the preferred way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we can't verify if the code compiles with a preproc if it is set to false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That totally makes sense, thank you for the explanation.
src/battle_setup.c
Outdated
@@ -899,6 +899,9 @@ u8 GetTrainerBattleTransition(void) | |||
u32 trainerId = SanitizeTrainerId(gTrainerBattleOpponent_A); | |||
u32 trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); | |||
|
|||
if (VarGet(gSpecialVar_0x8003) == 1 && BATTLE_FRONTIER_INTRO_FOR_BP_FIGHTS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you switch those? The config should always be checked first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the easiest way to check Battle Points for review purposes?
src/battle_script_commands.c
Outdated
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG) | ||
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the alignment here was correct. Please revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I turned this into a draft because I found a bug where a trainer might drop bp. |
Using a different special variable would probably be best here. Just make sure to confirm that it does not clash with a different variable. |
This should not depend on scripting variables. Instead I would suggest adding a callnative or specia to set an ewram variable |
I concur. While I'm happy to see my commit is useful to some people, the implementation should be heavily scrutinized as it's not very good and quite limited in scope. That said, I have no desire to revisit the code myself anytime soon - I don't even remember what I did or why (thanks to a long hiatus). |
I'm going to close the PR then |
Sounds good, sadly I currently don´t have the time to work on it. |
This allows the earning of Battle Points instead of money for scripted trainer battles by setting two variables.
Description
Mainly implemented the tutorial Scyrous made with slight changes:
People who collaborated with me in this PR
This was originally written by by @Scyrous and can be found in the pret scripting tutorial section.
Original commit
Discord contact info
laserxdolphin